package com.lcp;


import com.lcp.ui.StageController;
import com.lcp.ui.MainController;
import javafx.application.Application;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

import static com.lcp.utils.R.mainViewID;
import static com.lcp.utils.R.mainViewRes;


public class MainApp extends Application {

    private StageController stageController;

    @Override
    public void start(Stage primaryStage){
        Application.setUserAgentStylesheet(STYLESHEET_CASPIAN);
        //新建一个StageController控制器
        stageController = new StageController();
        //将主舞台交给控制器处理
        stageController.setPrimaryStage("primaryStage", primaryStage);
        //加载两个舞台，每个界面一个舞台
        stageController.loadStage(mainViewID, mainViewRes,StageStyle.DECORATED);
        //显示MainView舞台
        stageController.getStage(mainViewID).show();
        Font.loadFont(MainApp.class.getResource("/pages/layout/css/font.eot").toExternalForm(),10);
        Font.loadFont(MainApp.class.getResource("/pages/layout/css/font.ttf").toExternalForm(),10);
        Font.loadFont(MainApp.class.getResource("/pages/layout/css/font.woff").toExternalForm(),10);
        MainController.getMainController().toIndex();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
